package com.ad.nbi.epirpsystem.server;

import org.omg.CORBA.BooleanHolder;
import org.omg.CORBA.IntHolder;

import com.ad.nbi.Constants;

import AlarmIRPConstDefs.AlarmInformationIdAndSev;
import AlarmIRPConstDefs.AlarmTypeOperations;
import AlarmIRPConstDefs.AttributeNameValueOperations;
import AlarmIRPConstDefs.BadAcknowledgeAlarmInfoSeqHolder;
import AlarmIRPConstDefs.BadAlarmInformationIdSeqHolder;
import AlarmIRPConstDefs.DNOpt;
import AlarmIRPConstDefs.NotificationTypeOperations;
import AlarmIRPSystem.AcknowledgeAlarms;
import AlarmIRPSystem.AlarmInformationIteratorHolder;
import AlarmIRPSystem.ClearAlarms;
import AlarmIRPSystem.CommentAlarms;
import AlarmIRPSystem.GetAlarmCount;
import AlarmIRPSystem.GetAlarmIRPNotificationProfile;
import AlarmIRPSystem.GetAlarmIRPOperationsProfile;
import AlarmIRPSystem.GetAlarmIRPVersions;
import AlarmIRPSystem.GetAlarmList;
import AlarmIRPSystem.UnacknowledgeAlarms;
import CosNotification.StructuredEvent;
import ManagedGenericIRPConstDefs.Method;
import ManagedGenericIRPConstDefs.Signal;
import ManagedGenericIRPConstDefs.StringOpt;
import ManagedGenericIRPSystem.InvalidParameter;
import ManagedGenericIRPSystem.OperationNotSupported;
import ManagedGenericIRPSystem.ParameterNotSupported;

/**
 * This class is the implemetation object for your IDL interface.
 *
 * Let the Eclipse complete operations code by choosing 'Add unimplemented methods'.
 */
public class AlarmIRPServerImpl extends AlarmIRPSystem.AlarmIRPPOA {
	/**
	 * Constructor for AlarmIRPServerImpl 
	 */
	public AlarmIRPServerImpl() {
	}

	@Override
	public String[] get_alarm_irp_versions() throws GetAlarmIRPVersions {
		String[] version = { Constants.VERSION.Alarm };
		return version;
	}

	@Override
	public Method[] get_alarm_irp_operations_profile(String alarm_irp_version)
			throws InvalidParameter, OperationNotSupported,
			GetAlarmIRPOperationsProfile {
		if(!Constants.VERSION.Alarm.equals(alarm_irp_version)){
			throw new InvalidParameter();
		}
		Method[] methods = new Method[] {
				new Method("get_alarm_irp_versions",
						new String[] { "" }),
				new Method("get_alarm_irp_operations_profile",
						new String[] { "String:alarm_irp_version" }),
				new Method("get_alarm_irp_notification_profile",
						new String[] { "String:alarm_irp_version" })
		};
		return methods;
	}

	@Override
	public Method[] get_alarm_irp_notification_profile(String alarm_irp_version)
			throws InvalidParameter, OperationNotSupported,
			GetAlarmIRPNotificationProfile {
		Method[] methods = new Method[1];

			methods[0] = new Method(NotificationTypeOperations.NOTIFY_FM_ACK_STATE_CHANGED, new String[] { AttributeNameValueOperations.ACK_USER_ID });
			methods[1] = new Method(NotificationTypeOperations.NOTIFY_FM_ALARM_LIST_REBUILT, new String[] { AttributeNameValueOperations.ACK_USER_ID });
			methods[2] = new Method(NotificationTypeOperations.NOTIFY_FM_CHANGED_ALARM, new String[] { AttributeNameValueOperations.ACK_USER_ID });
			methods[3] = new Method(NotificationTypeOperations.NOTIFY_FM_CLEARED_ALARM, new String[] { AttributeNameValueOperations.ACK_USER_ID });
			methods[4] = new Method(NotificationTypeOperations.NOTIFY_FM_COMMENT_ADDED, new String[] { AttributeNameValueOperations.ACK_USER_ID });
			methods[5] = new Method(NotificationTypeOperations.NOTIFY_FM_NEW_ALARM, new String[] { AttributeNameValueOperations.ACK_USER_ID });
			methods[6] = new Method(NotificationTypeOperations.NOTIFY_FM_POTENTIAL_FAULTY_ALARM_LIST, new String[] { AttributeNameValueOperations.ACK_USER_ID });
		
		return methods;
	}

	@Override
	public Signal acknowledge_alarms(
			AlarmInformationIdAndSev[] alarm_information_id_and_sev_list,
			String ack_user_id, StringOpt ack_system_id,
			BadAcknowledgeAlarmInfoSeqHolder bad_ack_alarm_info_list)
			throws InvalidParameter, ParameterNotSupported, AcknowledgeAlarms {

		return null;
	}

	@Override
	public Signal unacknowledge_alarms(String[] alarm_information_id_list,
			String ack_user_id, StringOpt ack_system_id,
			BadAlarmInformationIdSeqHolder bad_alarm_information_id_list)
			throws InvalidParameter, OperationNotSupported,
			UnacknowledgeAlarms, ParameterNotSupported {

		return null;
	}

	@Override
	public Signal comment_alarms(String[] alarm_information_id_list,
			String comment_user_id, StringOpt comment_system_id,
			String comment_text,
			BadAlarmInformationIdSeqHolder bad_alarm_information_id_list)
			throws InvalidParameter, OperationNotSupported, CommentAlarms,
			ParameterNotSupported {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Signal clear_alarms(String[] alarm_information_id_list,
			String clear_user_id, StringOpt clear_system_id,
			BadAlarmInformationIdSeqHolder bad_alarm_information_id_list)
			throws InvalidParameter, OperationNotSupported, ClearAlarms,
			ParameterNotSupported {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public StructuredEvent[] get_alarm_list(StringOpt filter,
			DNOpt base_object, BooleanHolder flag,
			AlarmInformationIteratorHolder iter) throws InvalidParameter,
			GetAlarmList, ParameterNotSupported {
		
		return new StructuredEvent[] {};
	}

	@Override
	public void get_alarm_count(StringOpt filter, IntHolder critical_count,
			IntHolder major_count, IntHolder minor_count,
			IntHolder warning_count, IntHolder indeterminate_count,
			IntHolder cleared_count) throws InvalidParameter,
			OperationNotSupported, GetAlarmCount, ParameterNotSupported {
	
		
	}
}
